package com.zdzx.model.dic;

public enum FileType {
	
	BANNER("BANNER","轮播图"), //轮播图
	ARTICLE("ARTICLE","文章插入"),
	CONTENT0("ARTICLE/CONTENT0","文章内容"),
	CONTENT1("ARTICLE/CONTENT1","文章内容"),
	COURSE("COURSE","视频"),
	USER_HEAD("USER_HEAD","用户头像"),
	RECORDS("RECORDS","企业档案"),
	TENANT("TENANT","租户"),
	CERTIFICATE("CERTIFICATE","证书");
	
	private String key;
	private String value;
	
	private FileType(String key, String value) {
		this.key = key;
		this.value = value;
	}
	
	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	

	public static boolean hasKey(String key) {
		FileType[] values = FileType.values();
		for (FileType type : values) {
			System.out.println(type.name()+"-----------------"+(key.contains("/")?key.replace("/", "_"):key.toUpperCase()));
			if(type.name().equals(key.contains("/")?key.replace("/", "_").toUpperCase():key.toUpperCase())) {
				return true;
			}
		}
		return false;
	}
}
